package org.stone.project.tx.sysEnum;

import cn.hutool.core.util.ObjectUtil;

public enum ResourceType {
    USER(1,"用户资源"),
    GROUP(2,"群组资源")
    ;
    public Integer code;

    public String describ;

    ResourceType(Integer code, String describ) {
        this.code = code;
        this.describ = describ;
    }

    public static ResourceType getInstance(Integer code){
        if (ObjectUtil.isNull(code)){
            return null;
        }
        ResourceType[] values = values();
        for (ResourceType value : values) {
            if (value.code.equals(code))
                return value;
        }
        return null;
    }
}
